<template>
<div class="seller" ref="sellerscroll">
  <div class="seller-wrap">
    <div class="seller-info">
      <div class="seller-left">
        <div class="seller-name">{{seller.name}}</div>
        <div class="seller-num">
          <star :size="24" :score="seller.score"></star>
          <i>({{seller.ratingCount}})</i>
          <span>月售{{seller.sellCount}}单</span>
        </div>
      </div>
      <div class="seller-right">已收藏</div>
    </div>
    <div class="delivery">
      <div>
        <p>起送价</p>
        <p><span>{{seller.minPrice}}元</span></p>
      </div>
      <div>
        <p>商家配送</p>
        <p><span>{{seller.deliveryPrice}}元</span></p>
      </div>
      <div>
        <p>平均配送时间</p>
        <p><span>{{seller.deliveryTime}}元</span></p>
      </div>
    </div>
    <div class="line"></div>
    <div class="announce">
      <h1>公告与活动</h1>
      <p>{{seller.bulletin}}</p>
      <ul>
        <li v-for="(item,index) in seller.supports"><i class="icon" :class="classMap[seller.supports[index].type]"></i><span>{{seller.supports[index].description}}</span>
        </li>
      </ul>
    </div>
  </div>
</div>
</template>

<script type="text/ecmascript-6">
  import BScroll from 'better-scroll';
  import star from '../../components/star/star.vue'

  const ERR_OK=0;
export default{
  props:{
    seller:{
      type:Object
    }
  },
  data:{
//    seller:[]
  },
  components:{
    star
  },
  created(){
    this.classMap = ['decrease', 'discount', 'guarantee', 'invoice', 'special']
  }
}
</script>

<style>
  .seller{position: absolute;top: 174px;left: 0;width: 100%;overflow: hidden;bottom:0px}
  .line{width: 100%;height: 18px;background-color: #f3f5f7;border-top: 1px solid #e6e7e8;border-bottom: 1px solid #e6e7e8;}

  .icon{display: inline-block; width: 24px; height: 24px;}
  .decrease{ background: url(../../../resource/img/decrease_1@2x.png);}
  .discount{ background: url(../../../resource/img/discount_1@2x.png);}
  .guarantee{ background: url(../../../resource/img/guarantee_1@2x.png);}
  .invoice{ background: url(../../../resource/img/invoice_1@2x.png);}
  .special{ background: url(../../../resource/img/special_1@2x.png);}
</style>
